package promote.brozen.dubbo.providers.spi;

import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.extension.Activate;
import org.apache.dubbo.rpc.*;

/**
 * @author Brozen
 * @date 2020/9/11 8:55 AM
 * @email brozen@qq.com
 */
@Activate(group = "provider")
public class PrinterFilter implements Filter {

    public PrinterFilter() {
        System.out.println("Printer filter constructed");
    }

    @Override
    public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
        URL url = invoker.getUrl();
        System.out.println(url.toString());
        return invoker.invoke(invocation);
    }

}
